A Hampshire man has been sentenced to 17 years in prison for murder in what the crown prosecutor labelled a “despicable act of violence”.